<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // function pow(x, n) {
      //   let r = 1;
      //   for (let i = 0; i < n; i++) {
      //     r *= x;
      //   }
      //   return r;
      // }
      function pow(x, n) {
        if (n === 0) return 1;
        return x * pow(x, n - 1);
      }
      console.log(pow(2, 4));
    </script>
  </body>
</html>
